import { HTTP } from "../until/http-p.js";
class BookModel extends HTTP{
  getHotlist(){
    return this.request({
      url:"/book/hot_list"
    });
  }
  getMybookCount(){
    return this.request({
      url:"/book/favor/count"
    })
  }
  getDetail(id){
    return this.request({
      url:`/book/${id}/detail`
    });
  }
  getLikeStatus(id){
    return this.request({
      url:`/book/${id}/favor`
    })
  }
  getComments(id){
    return this.request({
      url: `/book/${id}/short_comment`
    })
  }
  postComment(id,comment){
    return this.request({
      url:'/book/add/short_comment',
      method:"POST",
      data:{
        book_id:id,
        content:comment
      }
    })
  }
  search(start, q) {
    return this.request({
      url: "/book/search?summary=1",  //为1是获取简要信息
      data: {
        q: q,
        start: start
      }
    })
  }
}
export {BookModel} 